package StudyCode.summary.Basic.stringbuilder;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class StringBuilderMethod {
	public static void main(String[] args) {
		StringBuilder buffer = new StringBuilder("Hello World By Java");

		System.out.printf("buffer = %s\nlength = %d\ncapacity = %d\n\n", buffer.toString(), buffer.length(), buffer.capacity());

		buffer.ensureCapacity(75);
		System.out.printf("New capacity = %d\n\n", buffer.capacity());

		buffer.setLength(10);
		System.out.printf("New length = %d\nbuffer = %s\n", buffer.length(), buffer.toString());
	}
}
